home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / comm / pirch32.zip / COUNT.PIL < prev    next >
Text File  |  1996-07-22  |  764b  |  29 lines

  1. { SAMPLE PIL SCRIPT [COUNT] 
  2. Usage /runscript [COUNT]
  3. Counts the people in the channel, seperating ops and 
  4. undernet bots }
  5. ops := 0;
  6. bots := 0;
  7. usercount := strtoint($members);
  8. for i := 1 to usercount do
  9. begin
  10.     $s := nicklist($audience,i);
  11.     if $s = 'X' then 
  12.         bots := bots + 1;
  13.     if $s = 'W' then 
  14.         bots := bots + 1;
  15.     if isop($audience,$s) then
  16.         ops := ops + 1;
  17. end;
  18. if bots = 1 then
  19.     $s2 := ' is a service bot';
  20. if bots <> 1 then 
  21.     $s2 := ' are service bots';
  22. ops := ops - bots;
  23. if usercount > 0 then
  24.     percentage := ops * 100 / usercount
  25. else 
  26.     percentage := 0;
  27. command('/msg ',$audience,' There are ',$members, ' members of ',$audience,' (',ops,' are ops and ',bots,$s2,')  ',
  28.     percentage,'% of ',$audience,' is occupied by ops');
  29.